<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*function fun() {
        console.log('i an outside');
    }
    (function () {
        if(false){
            function fun() {
                console.log('i an inside');
            }
        }

        fun(); /!*报错  预解析*!/
    })()*/
</script>
<script >
    console.log('ES6:');

    function fun() {
        console.log('i an outside');
    }
    // 有大括号 就是块级作用域了
    {
        if(false){
            function fun() {
                console.log('i an inside');
            }
        }

        fun(); /*报错  预解析*/
    }
</script>

</body>
</html>